<template>
	<view class="news">
		<view class="order_title" @click="$linkTo('/pagesB/news/System')">
			<view class="title_left ">
				系统通知
			</view>
			<view class="title_right">
				<uni-badge v-if="content.system_count!=0" type="error" size="small" :text="content.system_count"></uni-badge>
			</view>
		</view>
		<view class="order_title" @click="$linkTo('/pagesB/news/Order')">
			<view class="title_left left1">
				订单消息
			</view>
			<view class="title_right">
				<uni-badge v-if="content.order_count!=0" type="error" size="small" :text="content.order_count"></uni-badge>
			</view>
		</view>
		<view class="order_title" @click="$linkTo('/pagesB/news/Fans')">
			<view class="title_left left2">
				粉丝
			</view>
			<view class="title_right">
				<uni-badge v-if="content.fans_count!=0" type="error" size="small" :text="content.fans_count"></uni-badge>
			</view>
		</view>
		<view class="order_title" @click="$linkTo('/pagesB/news/reply')">
			<view class="title_left left3">
				回复
			</view>
			<view class="title_right">
				<uni-badge v-if="content.reply_count!=0" type="error" size="small" :text="content.reply_count"></uni-badge>
			</view>
		</view>
		<view class="order_title" @click="$linkTo('/pagesB/news/follow')">
			<view class="title_left left4">
				关注
			</view>
			<view class="title_right">
				<uni-badge v-if="content.attention_count!=0" type="error" size="small" :text="content.attention_count"></uni-badge>
			</view>
		</view>
		<view class="order_title" @click="$linkTo('/pagesB/news/thumbs-up')">
			<view class="title_left left5">
				点赞
			</view>
			<view class="title_right">
				<uni-badge v-if="content.like_count!=0" type="error" size="small" :text="content.like_count"></uni-badge>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:'',
				access_token:''
			};
		},
		onShow() {
			if(uni.getStorageSync('access_token')){
			this.access_token=JSON.parse(uni.getStorageSync('access_token'))
			}
			this.$request('/app/message/getMessages','post',{
				access_token:this.access_token
			}).then(res=>{
				console.log(res)
				this.content=res.content
			})
		}
	}
</script>

<style lang="less">
	.news{
		height: 100%;
		background-color: #F3F4F5;
		padding-top: 20rpx;
		.order_title{
			display: flex;
			justify-content: space-between;
			padding: 20rpx 40rpx;
			border-bottom:1px solid #EEEEEE;
			background: url(/pagesA/static/direction_right_gray.png)no-repeat 690rpx 25rpx ;
			background-size: 28rpx 28rpx;
			background-color: #fff;
			.title_left{
				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #111111;
				background: url(/pagesA/static/iconmes_xitong@2x5.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
				padding-left: 60rpx;
			}
			.left1{
				background: url(/pagesA/static/iconmes_xitong@2x4.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
			}
			.left2{
				background: url(/pagesA/static/iconmes_xitong@2x3.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
			}
			.left3{
				background: url(/pagesA/static/iconmes_xitong@2x2.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
			}
			.left4{
				background: url(/pagesA/static/iconmes_xitong@2x1.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
			}
			.left5{
				background: url(/pagesA/static/iconmes_xitong@2x6.png) no-repeat -8rpx -12rpx ;
				background-size: 60rpx 60rpx;
			}
			.title_right{
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #9DA5A8;
				padding-right: 30rpx;
			}
		}
	}
</style>
